package main

import "fmt"

// 结构体指针
type person struct {
	name, city string
	age        int8
}

func main() {
	var p = new(person)
	// *main.person
	fmt.Printf("%T\n", p)
	//(*p).name = "xinKong"
	//(*p).city = "city"
	//(*p).age = 18
	p.name = "xinKong"
	p.city = "city"
	p.age = 18
	fmt.Printf("%#v\n", p)

	// 取结构体的地址进行实例化
	p3 := &person{}
	p3.age = 18
	fmt.Printf("%T\n", p3)
	fmt.Printf("%#v\n", p3)
}
